/**
 * 
 */
package com.jie.eclipse.pan.swtitem.actiongroup;

import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.swt.SWT;

import com.jie.eclipse.pan.config.BaseConfig;
import com.jie.eclipse.pan.data.BaseDataEntities;
import com.jie.eclipse.pan.data.BaseDataEntity;
import com.jie.eclipse.pan.swtitem.table.PTableViewer;
import com.jie.eclipse.pan.swtitem.widgets.BaseComposite;
import com.jie.eclipse.pan.utils.Utils;
import com.jie.eclipse.pan.utils.handle.FileHandle;

/**
 * @author yanjie
 *
 */
public class TableColumnActionGroup extends BaseActionGroup{
	/**
	 * @param bc
	 * @param fileHandle
	 */
	public TableColumnActionGroup(BaseComposite bc, FileHandle fileHandle) {
		super(bc, fileHandle);
	}

	private class SaveRowAction extends Action{
		public SaveRowAction() {
			this.setImageDescriptor(getImageDesc("icon_rowsave.gif"));
			this.setText("保存");
		}
		
		@Override
		public void run() {
			getFileHandle().modelToXml();
			getFileHandle().getPllFormEditor().doSave(null);
		}
	}
	
	public void fillActionToolbars (ToolBarManager actionBarManager){
		SaveRowAction saverowAction = new SaveRowAction();
		actionBarManager.add(createActionContributionItem(saverowAction));
//		saverowAction.setAccelerator(SWT.F2);
//		this.getFileHandle().getDetailPage().getFormPage().getSite().getKeyBindingService().registerAction(saverowAction);
		actionBarManager.update(true);
	}
}
